<% include ./commons/header.html %>
<title>主页</title>
</head>
<body>
<% include ./commons/top-nav.html %>

    <div class="pageContainer carouselContainer" id="homeCarousel">
        <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel" >
            <ol class="carousel-indicators">
                <!--<?php if(isset($slideList)) : ?>-->
                    <% for(let key in slideList){ %>
                        <li data-target="#carouselExampleIndicators" data-slide-to="<%=key%>" class="carouselPoint <%= key==0?'active':'' %>"></li>
                    <%}%>

            </ol>
            <div class="carousel-inner">
                <% for(let key in slideList){ %>
                <div class="carousel-item <%= key==0?'active':'' %>">
                    <a href="<%= slideList[key]['link_url'] %>" target="_blank">
                        <img class="d-block w-100 slideImg" src="<%= slideList[key]['image'] %>">
                    </a>
                </div>
                <%}%>
                <!--<?php endif;?>-->
            </div>
            <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
        </div>
    </div>
<div class="pageContainer">
    <div class="homeArt">
        <?php if(isset($blockData)) : ?>

            <?php if(isset($blockData[1])) : $data=$blockData[1]?>
        <div id="1">
            <div class="homeArtHeader">
                <div class="homeArtHeaderItem">
                    <div class="colorDiv"> </div>
                    <?= $data[0]['category_name']?>
                </div>
                <div class="more"><a href="article/list?category_id=1">更多</a></div>
            </div>
            <div class="homeArtBody">
                <div class="homeArtBodyLeft">
                    <img class="homeArtBodyLeftImg" src="<?=$data[0]['title_image']?>" alt=""/>
                    <div class="homeArtBodyLeftInfo">
                        <div class="homeArtBodyLeftTitle"><a href="article?id=<?=$data[0]['article_id']?>"><?=$data[0]['title']?></div></a>
                        <div class="homeArtBodyLeftCont"><?=$data[0]['abstract']?>
                        </div>
                    </div>
                </div>
                <div class="homeArtBodyRight">
                    <ul class="homeArtBodyRightList">
                        <?php foreach($data as $key=>$item) : ?>
                            <?php if($key!==0):?>
                            <li>
                                <a  href="article?id=<?=$item['article_id']?>"  class="homeArtBodyRightLink"><?=$item['title']?></a>
                            </li>
                            <?php endif;?>
                        <?php endforeach;?>

                    </ul>
                </div>
            </div>
        </div>
            <?php endif?>


            <?php if(isset($blockData[2])) : $data=$blockData[2]?>
        <div id="2">
            <div class="homeArtHeader">
                <div class="homeArtHeaderItem">
                    <div class="colorDiv"> </div>
                    <?= $data[0]['category_name']?>
                </div>
                <div class="more"><a href="article/list?category_id=2">更多</a></div>
            </div>
            <div class="homeArtBody">
                <ul class="homeArtBodyImgList">
                    <?php foreach($data as $key=>$item) : ?>
                        <?php if($key<4):?>
                        <li class="homeArtBodyImgItem">
                            <a href="article?id=<?=$item['article_id']?>">
                                <img class="homeArtBodyImgListImg" src="<?=$item['title_image']?>" alt=""/>
                                <div class="homeArtBodyImgListTile" ><?=$item['title']?></div>
                            </a>
                        </li>
                        <?php endif;?>
                    <?php endforeach;?>
                </ul>
            </div>
        </div>
            <?php endif?>

            <?php if(isset($blockData[3])) : $data=$blockData[3]?>
        <div id="3">
            <div class="homeArtHeader">
                <div class="homeArtHeaderItem">
                    <div class="colorDiv"> </div>
                    <?= $data[0]['category_name']?>
                </div>
                <div class="more"><a href="article/list?category_id=3">更多</a></div>
            </div>
            <div class="homeArtBody" >
                <div class="seamlessScrolling">
                    <ul>
                        <?php foreach($data as $key=>$item) : ?>
                            <?php if($key<6):?>
                        <li>
                            <a href="article?id=<?=$item['article_id']?>">
                                <img class="homeArtBodyImgListImg imgScroll" src="<?=$item['title_image']?>" alt=""/>
                            </a>
                        </li>
                            <?php endif;?>
                        <?php endforeach;?>
                    </ul>
                </div>
            </div>
        </div>
            <?php endif?>


            <?php if(isset($blockData[4])) : $data=$blockData[4]?>
        <div id="4">
            <div class="homeArtHeader">
                <div class="homeArtHeaderItem">
                    <div class="colorDiv"> </div>
                    <?= $data[0]['category_name']?>
                </div>
                <div class="more"><a href="article/list?category_id=4">更多</a></div>
            </div>
            <div class="homeArtBody" >
                <ul class="logoLinkShow">
                    <?php foreach($data as $key=>$item) : ?>
                        <?php if($key<12):?>
                    <li>
                        <a href="article?id=<?=$item['article_id']?>">
                            <img src="<?=$item['title_image']?>" alt="">
                        </a>
                    </li>
                        <?php endif;?>
                    <?php endforeach;?>
                </ul>
            </div>
        </div>
            <?php endif?>
        <?php endif?>


    </div>
</div>

<div class="consult">
    <a href="consult"><img src="/assets/iconWord0.png" alt=""></a>
</div>
<?php include __DIR__."/commons/footer-2.phtml";?>
<?php include __DIR__."/commons/footer-1.phtml";?>

    </body>
</html>
